package com.usian.feign;

import com.usian.pojo.TbItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient("usian-cart-service")
public interface CartFeign {

    /**
     * @param userId
     * @param cart
     * @return
     */
    /*把购物商品列表写入redis
     * */
    @RequestMapping("/insertCart")
    Boolean insertCart(@RequestParam String userId, @RequestBody Map<String, TbItem> cart);



    /**
     * 从redis中查询购物车
     * @param userId
     * @return
     */
    @RequestMapping("/selectCartByUserId")
    Map<String, TbItem> selectCartByUserId(@RequestParam String userId);


}
